﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Web;
using System.Web.Mvc;

namespace Bmz.Laboratory.JQueryEffects.Areas.JQueryEffects.Controllers
{
    public class ScrollController : Controller
    {
        //
        // GET: /JQueryEffects/Home/
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult AjaxScrollPage()
        {
            return View();
        }

        public class PageModel
        {
            public int pageIndex { get; set; }
            public int pageSize { get; set; }
        }
        
        public JsonResult AjaxData(PageModel model)
        {
            string message = "以便页面出现滚动条，限于篇幅本文此处略去这里尽量多些<br/>";
            string result = string.Empty;// "<h1>第" + model.pageIndex.ToString() + "页</h1><br />";
            for (int i = 0; i < model.pageSize; i++)
            {
                result += message;
            }
            Thread.Sleep(1000);
            return Json(result);
        }
	}
}